Part 1.2

Derivative of Gaussian Filter.

Finite Difference operator on Gaussian filtered-image

With \(f\) being the grayscale cameraman.png image again, let \(g\) denote a Gaussian filter. For our results, we used window size \(k=9\) and standard deviation \(\sigma = 1.5\) to create our \(9\times 9\) Gaussian filter. Using once again scipy.signal.convolve2d with symmetric boundaries and mode='same', we get the images below:
Original image \(f\) Image with Gaussian Blur \(f\star g\) Blurred Image with Dx filter \( (f\star g) \star D_x\) Blurred Image with Dy filter \( (f\star g) \star D_y \) Blurred Image with Gradient Magnitude filter

Derivative of Gaussian filters on the image

Using once again scipy.signal.convolve2d with symmetric boundaries and mode='same', the difference now is that we first compute \( g\star D_x\) and \(g\star D_y\) and then later compute \( (g\star D_x) \star f\) and \( (g\star D_y) \star f\). We will see that the outputs from both approaches are identical, which shows that convolution commutes and associates. We get the images below:
Original image \(f\) Image with DoG x filter \( (g\star D_x) \star f\) Image with Dog y filter \( (g\star D_y) \star f\) Gradient Magnitude Filter

Comparison with Part 1.1: Removal of Noise

One of the most significant features in comparing images from Part 1.1 and Part 1.2 is that there is virtually no noise near the bottom of the binarized images in Part 1.2 images as compared to Part 1.1 images. Furthermore, we have much thicker edges in this case, so DoG filters seem to be visually functioning a lot better than standard finite difference operators. Note that a Gaussian filter has these properties because as a smooth function, convolution smoothens out the images and removes the effect of outliers (the binarizer ensures now lower-value outliers are removed). However, it is also important to note that blurring decreases the value of all pixels, so our threshold choice thresh = 0.07 is also much lower to actually detect edges. Specifically, while at the same thresh finite difference operators detect more edges, the edges detected by DoG filters are thicker and more immune to noise.

Commutativity of Convolution

Notice that DoG filtering vs. Blurring and then using finite difference operators produces virtually the same output, barring minor differences due to noise:
Gradient comparison Dx comparison Dy comparison This simply reflects the facts that \(f\star(g\star h) = (f\star g) \star h\) and \(f\star g = g\star f\) for convolutions, so we can do convolution operations in an order that is most convenient.